package com.ant.view.cn;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.ant.view.cn.activities.Demo002;
import com.ant.view.cn.activities.Demo003;
import com.ant.view.cn.activities.Demo004;
import com.ant.view.cn.activities.Demo006;
import com.ant.view.cn.activities.Demo01;
<<<<<<< HEAD
import com.ant.view.cn.activities.Demo1001;
import com.ant.view.cn.activities.Demo3001;
=======
import com.ant.view.cn.activities.Demo2001;
import com.ant.view.cn.activities.SimCardActivity;
>>>>>>> 51192f55fe67d63fc3baea13ff1e6957d4e43df2
import com.ant.view.cn.base.BaseActivity;
import com.ant.view.cn.utils.AntLog;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends BaseActivity {
    private ListView lv;
    private List<String> slt;
    private List<Class> clt;

    @Override
    public int getLaout() {
        slt = new ArrayList<>();
        clt = new ArrayList<>();
        return R.layout.activity_main;
    }

    @Override
    public void initView() {
        lv = (ListView) findViewById(R.id.ac_main_listview_001);

    }

    @Override
    public void initData() {
        slt.add("index");
        clt.add(Demo01.class);
        slt.add("customer view ant");
        clt.add(Demo002.class);
        slt.add("ant surface view");
        clt.add(Demo003.class);
<<<<<<< HEAD
        slt.add("demo1001");
        clt.add(Demo1001.class);
        slt.add("list soft ant");
        clt.add(Demo3001.class);
=======
        slt.add("this is my view001");
        clt.add(Demo004.class);
        slt.add("this is simcard test");
        clt.add(SimCardActivity.class);
        slt.add("my Button");
        clt.add(Demo006.class);


        slt.add("animal demo001");
        clt.add(Demo2001.class);
>>>>>>> 51192f55fe67d63fc3baea13ff1e6957d4e43df2

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_activated_1, slt);
        lv.setAdapter(adapter);
    }

    @Override
    public void initListener() {
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                AntLog.i(TAG, "i==" + i);
                Intent in = new Intent(MainActivity.this, clt.get(i));
                MainActivity.this.startActivity(in);
            }
        });
    }
}
